package com.honeyms.project.blog.blogcontentdetail.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.honeyms.project.blog.blogcontentdetail.mapper.BlogContentDetailMapper;
import com.honeyms.project.blog.blogcontentdetail.domain.BlogContentDetail;
import com.honeyms.project.blog.blogcontentdetail.domain.Validation;
import com.honeyms.project.blog.blogcontentdetail.service.IBlogContentDetailService;
import com.honeyms.common.utils.text.Convert;

/**
 * 帖子详情Service业务层处理
 * 
 * @author honeyms
 * @date 2020-10-12
 */
@Service
public class BlogContentDetailServiceImpl implements IBlogContentDetailService 
{
    @Autowired
    private BlogContentDetailMapper blogContentDetailMapper;

    /**
     * 查询帖子详情
     * 
     * @param contentDetailId 帖子详情ID
     * @return 帖子详情
     */
    @Override
    public BlogContentDetail selectBlogContentDetailById(Long contentDetailId)
    {
        return blogContentDetailMapper.selectBlogContentDetailById(contentDetailId);
    }


    /**
     * 效验用户点赞
     * 
     * @return 用户点赞统计
     */
    @Override
    public List<Validation> validationZan() 
    {
    	return blogContentDetailMapper.validationZan();
    }
    
    /**
     * 效验用户收藏
     * 
     * @return 用户收藏统计
     */
    @Override
    public List<Validation> validationFavorites() 
    {
    	return blogContentDetailMapper.validationFavorites();
    }
    
    /**
     * 查询帖子详情列表
     * 
     * @param blogContentDetail 帖子详情
     * @return 帖子详情
     */
    @Override
    public List<BlogContentDetail> selectBlogContentDetailList(BlogContentDetail blogContentDetail)
    {
        return blogContentDetailMapper.selectBlogContentDetailList(blogContentDetail);
    }

    /**
     * 新增帖子详情
     * 
     * @param blogContentDetail 帖子详情
     * @return 结果
     */
    @Override
    public int insertBlogContentDetail(BlogContentDetail blogContentDetail)
    {
        return blogContentDetailMapper.insertBlogContentDetail(blogContentDetail);
    }

    /**
     * 修改帖子详情
     * 
     * @param blogContentDetail 帖子详情
     * @return 结果
     */
    @Override
    public int updateBlogContentDetail(BlogContentDetail blogContentDetail)
    {
        return blogContentDetailMapper.updateBlogContentDetail(blogContentDetail);
    }

    /**
     * 删除帖子详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBlogContentDetailByIds(String ids)
    {
        return blogContentDetailMapper.deleteBlogContentDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除帖子详情信息
     * 
     * @param contentDetailId 帖子详情ID
     * @return 结果
     */
    @Override
    public int deleteBlogContentDetailById(Long contentDetailId)
    {
        return blogContentDetailMapper.deleteBlogContentDetailById(contentDetailId);
    }
}
